package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/**
 * @Author Justin Parker
 * @Date 2024/7/17 0017 9:43
 * @Version 1.0
 */
public class OSWDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("hello.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);

        osw.write("喜欢");
        osw.write("大雷");
        System.out.println("写入完毕");
        osw.close();

    }
}
